<admintpl file="header" />
<style>
	*{margin:0; padding:0;}
	body{font-family: "Microsoft Yahei", "hiragino sans gb", Helvetica, Arial, Tahoma;}
	.shdo{position: fixed; left:0; top:0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10; display: none;}
	.stan-box{padding:10px 20px; width: 400px; max-height: 500px; background: #fff; position: fixed; left:100px; top:100px; z-index: 11; display: none;}
	.simgBox{max-height: 440px; overflow: auto; text-align: center;}
	.simgBox img{}
	.stit{height: 30px;}
	.stit .yuan{font-size: 14px;}
	.stit .cuo{display: block; width: 20px; height: 20px; color: #fff; background: #007aff; line-height: 20px; text-align: center; position: absolute; right:0; top:0; cursor: pointer;}
	.sbot{height: 30px; }
	.sbot span{height: 26px; line-height: 26px; width: 50px; font-size: 12px; color: #fff;  background: #007aff;  float: right; text-align: center; border-radius: 2px;margin-top: 6px; cursor: pointer;}
	.tanimg{cursor:pointer;}
    .aBtnInput{display: inline-block; padding:0 2px; background: #f1f1f1; border:1px solid #a5a5a5; border-radius: 2px; }
    .aBtnInput:link,.aBtnInput:visited,.aBtnInput:hover,.aBtnInput:active{text-decoration: none;color: #333;}
    .table-list input{
    	width:100px;
    }
    .c-tan-shadow{position: fixed; left:0; top:0; width:100%; height:100%; background: rgba(0,0,0,0.3);display: none;}
    .c-tan-box{width:auto; padding:20px 30px 10px; height:auto; background: #fff;position: fixed; left:50%;  top:50%; margin-top:-118px; margin-left:-164px; display: none;}
    .c-tan-box .liang{margin:4px 0;}
    .c-tan-box .liang span{margin-right:10px; font-size: 14px;}
    .c-tan-box .liang input{font-size: 14px; height:26px; text-align: center;}
    .c-btn{ text-align: center;}
    .c-btn span{display: inline-block; width: 40%; height:30px; line-height: 30px; cursor: pointer;}
    .c-btn span:hover{color: #ff0511;}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Lottery/index')}">彩种管理</a></li>
		</ul>
		<form method="post" class="well form-search">
			彩种名称：
					<input type="text" name="name" style="width: 200px;" value="{:I('request.name')}" placeholder="请输入彩种名称">&nbsp;&nbsp; 
			彩种:
					<select name="type">
					<option value="0">请选择</option>
					<foreach name="type" item="vo">
						<option value="{$vo.id}" <?php if($typeid == $vo['id']){echo "selected";}?>>{$vo.name}</option>
					</foreach>	
					</select>
					<input type="submit" class="btn btn-primary" value="搜索" />
					<a class="btn btn-danger" href="{:U('Lottery/index')}">清空</a>
			</form>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th>彩种</th>
						<th>名称</th>
						<th>是否出售</th>
						<th>最低奖金</th>
						<th>开始时间</th>
						<th>结束时间</th>
						<th>间隔时间(分钟)</th>
						<th>封单时间(分钟)</th>
						<th>人工开奖</th>
					</tr>
				</thead>
				<tbody>
				<php>if(!empty($existdata)):</php>
					<foreach name="data" item="vo">
					<tr>
						<td>{$vo.typename}</td>
						<td>{$vo.name}</td>
						<td>
							<php>if($vo['type']==1){</php>
							<a href="{:U('lottery/lottery_calss_type',array('id'=>$vo['id'],'type'=>0))}">否</a>
							<php> }else{</php>
							<a href="{:U('lottery/lottery_calss_type',array('id'=>$vo['id'],'type'=>1))}">是</a>
							<php>}</php>
						</td>
						<td>最低奖金</td>	
						<td><input type="input" name="stime" value="{$vo.stime}" class="c-tan" data-name="开始时间" data-type="stime" data-id="{$vo.id}"></td>
						<td><input type="input" name="etime" value="{$vo.etime}" class="c-tan" data-name="结束时间" data-type="etime" data-id="{$vo.id}"></td>
						<td><input type="input" name="jian_time" value="{$vo.jian_time}" class="c-tan"" data-name="间隔时间" data-type="jian_time" data-id="{$vo.id}"></td>
						<td><input type="input" name="feng_time" value="{$vo.feng_time}" class="c-tan"" data-name="封单时间" data-type="feng_time" data-id="{$vo.id}"></td>
						<td><a href="{:U('lottery/rengong',array('id'=>$vo['id'],'p'=>$p))}" style="cursor: pointer;">人工开奖</a></td>
					</tr>
					</foreach>
				<php>else:</php>
				<tr>
					<td style="text-align: center;" colspan="10">未搜索到相关数据</td>
				</tr>
				<php>endif;</php>
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
		</form>
	</div>
		<!-- 弹出框 -->
<div class="c-tan-shadow"></div>
<div class="c-tan-box">
    <div class="liang"><span id="spanbox"></span><input class="c-shi" type="text"></div>
    <input type="hidden" class="type">
    <input type="hidden" class="classid">
    <div class="c-btn">
        <span class="c-tan-xiao">取消</span>
        <span class="c-tan-sure">确认</span>
    </div>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
$(".c-tan").click(function(){
		var name = $(this).data("name");
		var type = $(this).data("type");
		var id = $(this).data("id");
		$(".c-tan-shadow,.c-tan-box").show();
		$("#spanbox").html(name);
		$(".c-shi").attr("value",$(this).val());
		$(".classid").attr("value",id);
		$(".type").attr("value",type);
});
$(".c-tan-xiao").click(function(){
		$(".c-tan-shadow,.c-tan-box").hide();
});
$(".c-tan-sure").click(function(){
	//history.go(0);
	$(".c-tan-shadow,.c-tan-box").hide();
});
$(".c-tan-sure").click(function(){
	var time = $(".c-shi").val();
	var type = $(".type").val();
	var id = $(".classid").val();
	$.ajax({
			type: "get",
			url: "{:U('Lottery/xg_time')}",
			data: {"time": time, "type": type, "id": id},
			dataType: "json",
			success: function(data) {
				if(data == 1){
					history.go(0);
				}else{
					alert("修改失败");
				}
			}
		});
})
function ren(id){
	window.location.href="rengong/id/"+id;
}
</script>
</body>
</html>